import c4d


DiffuseName = "Diffuse"
GlossyName = "Glossy"
SpecularName = "Specular"
UniversalName = "Universal"
MetallicName = "Metallic"
ToonName = "Toon"

SUBMaterialNodeID = 1040369


SET_RENDERAOV_IN_CNT=3700
SET_RENDERAOV_INPUT_0=3740

ID_OCTANE_VIDEO_POST = 1029525 # octane render
ID_OCTANE_RENDERPASS_AOV = 1057006 # pass
VP_BUFFER_TYPE      = 1010
VP_COLOR_SPACE      = 1028
# RenderPassAOV_h
RNDAOV_NAME=900
RNDAOV_ENABLED=994
RNDAOV_TYPE=995
RNDAOV_TYPE_NAME=1101

RNDAOV_DIFFUSE=188
RNDAOV_DIF_FILTER=191
RNDAOV_REFLECTION=222
RNDAOV_REFL_FILTER=225
RNDAOV_REFRACT_FILTER=230
RNDAOV_TRANSM_FILTER=242
RNDAOV_TEX_TANGENT=240
RNDAOV_UVSET=3459
RNDAOV_CRYPTOMATTE=185

RNDAOV_EMIT=196
RNDAOV_ENV=197
RNDAOV_DIF_D=189
RNDAOV_DIF_I=193
RNDAOV_REFL_D=223
RNDAOV_REFL_I=227
RNDAOV_REFRACT=229
RNDAOV_TRANS=244
RNDAOV_SSS=238
RNDAOV_POST=221
RNDAOV_NOISE=212
RNDAOV_SHADOW=237
RNDAOV_LAYER_BLACKSHD=202
RNDAOV_LAYER_COLORSHD=204
RNDAOV_LAYER_REFLECTION=203

RNDAOV_POST_INCLUDE_ENV=3325
RNDAOV_IRRADIANCE=201
RNDAOV_LIGHT_DIRECTION=207
RNDAOV_VOLUME=246
RNDAOV_VOLUME_MASK=250
RNDAOV_VOLUME_EMISSION=248
RNDAOV_VOLUME_Z_DEPTH_FRONT=251
RNDAOV_VOLUME_Z_DEPTH_BACK=252
RNDAOV_CUSTOM=186
RNDAOV_GLOBALTEX=199
RNDAOV_CUSTOM_IDS=3390
RNDAOV_VISIBLE_AFTER=3391
RNDAOV_ZDEPTH_MAX=3392
RNDAOV_ZDEPTH_ENVDEPTH=3397
RNDAOV_UVMAX=3393
RNDAOV_MAXSPEED=3394
RNDAOV_AODIST=3395
RNDAOV_AOALPHASHD=3396
RNDAOV_WIRE_SHADING=3398
RNDAOV_WIRE_BMPNRML_MAP=3399
RNDAOV_WIRE_HGLTBACK=3400

RNDAOV_GEONORM=198
RNDAOV_SHDNORM=236
RNDAOV_SMOOTHNORM=253
RNDAOV_POSITION=220
RNDAOV_ZDEPTH=255
RNDAOV_MATID=210
RNDAOV_UV_COORD=245
RNDAOV_TANGENT=239
RNDAOV_WIRE=254
RNDAOV_OBJECT_ID=217
RNDAOV_AO=183
RNDAOV_MOTION_VECTOR=211
RNDAOV_RENDER_LAYER_ID=233
RNDAOV_RENDER_LAYER_MASK=234
RNDAOV_FSIZE=3347
RNDAOV_LIGHT_PASS_ID=209
RNDAOV_OBJECT_LAYER_COLOR=218
RNDAOV_BAKEGROUP_ID=184
RNDAOV_SMOOTHNORM_N=3442
RNDAOV_TANGENT_N=3446
RNDAOV_GEONORM_N=3440
RNDAOV_SHDNORM_N=3441
RNDAOV_POSITION_N=3443
RNDAOV_ZDEPTH_N=3444
RNDAOV_UV_COORD_N=3445
RNDAOV_MOT_VECTOR_N=3447
RNDAOV_TEX_TANGENT_N=3448

RNDAOV_DISTR_PT=3350
RNDAOV_DIST_TRACING=3351
RNDAOV_BEAUTY_DENOISER=3380
RNDAOV_DENOISER_DIFFUSE_D=190
RNDAOV_DENOISER_DIFFUSE_I=194
RNDAOV_DENOISER_REFLECT_D=224
RNDAOV_DENOISER_REFLECT_I=228
RNDAOV_DENOISER_REFRACTION=3385
RNDAOV_DENOISER_REMAINDER=232
RNDAOV_DENOISER_EMISSION=195
RNDAOV_DENOISER_VOLUME=247
RNDAOV_DENOISER_VOL_EMIS=249

RNDAOV_INFO_OPACITY=219
RNDAOV_INFO_ROUGHNESS=235
RNDAOV_INFO_DIFFUSE=192
RNDAOV_INFO_REFLECTION=3364
RNDAOV_INFO_REFL_FILTER=226
RNDAOV_INFO_REFRACTION=3365
RNDAOV_INFO_REFRACT_FILTER=231
RNDAOV_INFO_IOR=200
RNDAOV_INFO_TRANSMISSON=243
RNDAOV_RAW=3450
RNDAOV_LIGHT=205
RNDAOV_LIGHT_D=206
RNDAOV_LIGHT_I=208
RNDAOV_CRYPTO_TYPE=1821
RNDAOV_LIGHT_ID=1822

ID_OCTANE_BASE_MATERIAL = 1029501
ID_OCTANE_STANDARD_SURFACE = 1058763
ID_OCTANE_COMPOSITE_MATERIAL = 1040075
ID_OCTANE_MIX_MATERIAL = 1029622
ID_OCTANE_PORTAL_MATERIAL = 1029623
ID_OCTANE_CLIPPING_MATERIAL = 1056989
ID_OCTANE_SHADOWCATCHER_MAT = 1057003
ID_OCTANE_HAIR_MATERIAL = 1054119
OCTANE_MATERIALS = [ID_OCTANE_BASE_MATERIAL,
                    ID_OCTANE_STANDARD_SURFACE,
                    ID_OCTANE_MIX_MATERIAL,
                    ID_OCTANE_PORTAL_MATERIAL,
                    ID_OCTANE_CLIPPING_MATERIAL,
                    ID_OCTANE_SHADOWCATCHER_MAT,
                    ID_OCTANE_HAIR_MATERIAL,
                    ID_OCTANE_COMPOSITE_MATERIAL
                    ]


MAT_TYPE_DIFFUSE = 2510
MAT_TYPE_GLOSSY = 2511
MAT_TYPE_SPECULAT = 2513
MAT_TYPE_METALLIC = 2514
MAT_TYPE_TOON = 2515
MAT_TYPE_UNIVERSAL = 2516

BRDF_OCTANE = 0
BRDF_GGX = 2
BRDF_GGX_EP = 6

# Node IDs for Octane nodes
ID_OCTANE_FLOAT_TEXTURE = 1029506
ID_OCTANE_IMAGE_TEXTURE = 1029508
ID_OCTANE_RGBSPECTRUM = 1029504

ID_OCTANE_MULTIPLY_TEXTURE = 1029516
ID_OCTANE_SUBTRACT_TEXTURE = 1038878
ID_OCTANE_INVERT_TEXTURE = 1029514
ID_OCTANE_ADD_TEXTURE = 1038877
ID_OCTANE_MIXTEXTURE = 1029505

ID_OCTANE_COLORCORRECTION = 1029512
ID_OCTANE_GRADIENT_TEXTURE = 1029513
ID_OCTANE_CLAMP_TEXTURE = 1029511
ID_INSTANCE_RANGE_TEXTURE = 1039376
ID_OCTANE_FALLOFFMAP = 1029503
ID_OCTANE_DIRT_TEXTURE = 1029975
ID_OCTANE_CURVATURE_TEX = 1057004
ID_OCTANE_C4DNOISE_TEX = 1058853
ID_OCTANE_NOISE_TEXTURE = 1033698

ID_OCTANE_TRIPLANAR = 1038882
ID_OCTANE_TRANSFORM = 1030961
ID_OCTANE_DISPLACEMENT = 1031901
ID_OCTANE_TEXTURE_PROJECTION = 1031460
ID_OCTANE_BLACKBODY_EMISSION = 1029641
ID_OCTANE_TEXTURE_EMISSION = 1029642

ID_OCTANE_LIVEPLUGIN = 1029499 # Octane Live Viewer
ID_OCTANE_CAMERATAG = 1029524 # Octane Camera Tag
ID_OCTANE_ENVIRONMENT_TAG = 1029643
ID_OCTANE_OBJECTTAG = 1029603
ID_OCTANE_LIGHT_TAG = 1029526

ID_VOLUMEOBJECT = 1035792
ID_SCATTER_OBJECT = 1035961
ID_OCTANE_DAYLIGHT_TAG = 1029754

AOV_SYMBOLS: dict[int, str] = {
 c4d.RNDAOV_AO: 'Ao',
 c4d.RNDAOV_AOALPHASHD: 'Ao alpha shadow',
 c4d.RNDAOV_AODIST: 'Aodist',
 c4d.RNDAOV_BAKEGROUP_ID: 'Bakegroup Id',
 c4d.RNDAOV_BEAUTY_DENOISER: 'Beauty Denoiser',
 c4d.RNDAOV_CRYPTOMATTE: 'Cryptomatte',
 c4d.RNDAOV_CUSTOM: 'Custom',
 c4d.RNDAOV_CUSTOM_IDS: 'Custom Ids',
 c4d.RNDAOV_DENOISER_DIFFUSE_D: 'Denoiser diffuse direct',
 c4d.RNDAOV_DENOISER_DIFFUSE_I: 'Denoiser Diffuse indirect',
 c4d.RNDAOV_DENOISER_EMISSION: 'Denoiser Emission',
 c4d.RNDAOV_DENOISER_REFLECT_D: 'Denoiser Reflect direct',
 c4d.RNDAOV_DENOISER_REFLECT_I: 'Denoiser Reflect indirect',
 c4d.RNDAOV_DENOISER_REFRACTION: 'Denoiser Refraction',
 c4d.RNDAOV_DENOISER_REMAINDER: 'Denoiser Remainder',
 c4d.RNDAOV_DENOISER_VOLUME: 'Denoiser Volume',
 c4d.RNDAOV_DENOISER_VOL_EMIS: 'Denoiser Vol Emission',
 c4d.RNDAOV_DIFFUSE: 'Diffuse',
 c4d.RNDAOV_DIF_D: 'Diffuse direct',
 c4d.RNDAOV_DIF_FILTER: 'Diffuse Filter',
 c4d.RNDAOV_DIF_I: 'Diffuse indirect',
 c4d.RNDAOV_DISTR_PT: 'Distr Pt',
 c4d.RNDAOV_DIST_TRACING: 'Dist Tracing',
 c4d.RNDAOV_EMIT: 'Emit',
 c4d.RNDAOV_ENV: 'Env',
 c4d.RNDAOV_FSIZE: 'Fsize',
 c4d.RNDAOV_GEONORM: 'Geo normal',
 c4d.RNDAOV_GEONORM_N: 'Geonorm N',
 c4d.RNDAOV_GLOBALTEX: 'Globaltex',
 c4d.RNDAOV_INFO_DIFFUSE: 'Info Diffuse',
 c4d.RNDAOV_INFO_IOR: 'Info Ior',
 c4d.RNDAOV_INFO_OPACITY: 'Info Opacity',
 c4d.RNDAOV_INFO_REFLECTION: 'Info Reflection',
 c4d.RNDAOV_INFO_REFL_FILTER: 'Info Refl Filter',
 c4d.RNDAOV_INFO_REFRACTION: 'Info Refraction',
 c4d.RNDAOV_INFO_REFRACT_FILTER: 'Info Refract Filter',
 c4d.RNDAOV_INFO_ROUGHNESS: 'Info Roughness',
 c4d.RNDAOV_INFO_TRANSMISSON: 'Info Transmisson',
 c4d.RNDAOV_IRRADIANCE: 'Irradiance',
 c4d.RNDAOV_LAYER_BLACKSHD: 'Layer Blackshd',
 c4d.RNDAOV_LAYER_COLORSHD: 'Layer Colorshd',
 c4d.RNDAOV_LAYER_REFLECTION: 'Layer Reflection',
 c4d.RNDAOV_LIGHT: 'Light',
 c4d.RNDAOV_LIGHT_D: 'Light direct',
 c4d.RNDAOV_LIGHT_DIRECTION: 'Light Direction',
 c4d.RNDAOV_LIGHT_I: 'Light indirect',
 c4d.RNDAOV_LIGHT_PASS_ID: 'Light Pass Id',
 c4d.RNDAOV_MATID: 'Material id',
 c4d.RNDAOV_MAXSPEED: 'Maxspeed',
 c4d.RNDAOV_MOTION_VECTOR: 'Motion Vector',
 c4d.RNDAOV_MOT_VECTOR_N: 'Mot Vector N',
 c4d.RNDAOV_NOISE: 'Noise',
 c4d.RNDAOV_OBJECT_ID: 'Object Id',
 c4d.RNDAOV_OBJECT_LAYER_COLOR: 'Object Layer Color',
 c4d.RNDAOV_POSITION: 'Position',
 c4d.RNDAOV_POSITION_N: 'Position N',
 c4d.RNDAOV_POST: 'Post',
 c4d.RNDAOV_POST_INCLUDE_ENV: 'Post Include Env',
 c4d.RNDAOV_RAW: 'Raw',
 c4d.RNDAOV_REFLECTION: 'Reflection',
 c4d.RNDAOV_REFL_D: 'Refl direct',
 c4d.RNDAOV_REFL_FILTER: 'Refl Filter',
 c4d.RNDAOV_REFL_I: 'Refl indirect',
 c4d.RNDAOV_REFRACT: 'Refract',
 c4d.RNDAOV_REFRACT_FILTER: 'Refract Filter',
 c4d.RNDAOV_RENDER_LAYER_ID: 'Render Layer Id',
 c4d.RNDAOV_RENDER_LAYER_MASK: 'Render Layer Mask',
 c4d.RNDAOV_SHADOW: 'Shadow',
 c4d.RNDAOV_SHDNORM: 'Shdnorm',
 c4d.RNDAOV_SHDNORM_N: 'Shdnorm N',
 c4d.RNDAOV_SMOOTHNORM: 'Smoothnorm',
 c4d.RNDAOV_SMOOTHNORM_N: 'Smoothnorm N',
 c4d.RNDAOV_SSS: 'SSS',
 c4d.RNDAOV_TANGENT: 'Tangent',
 c4d.RNDAOV_TANGENT_N: 'Tangent N',
 c4d.RNDAOV_TEX_TANGENT: 'Tex Tangent',
 c4d.RNDAOV_TEX_TANGENT_N: 'Tex Tangent N',
 c4d.RNDAOV_TRANS: 'Trans',
 c4d.RNDAOV_TRANSM_FILTER: 'Transm Filter',
 c4d.RNDAOV_UVMAX: 'Uvmax',
 c4d.RNDAOV_UVSET: 'Uvset',
 c4d.RNDAOV_UV_COORD: 'Uv Coord',
 c4d.RNDAOV_UV_COORD_N: 'Uv Coord N',
 c4d.RNDAOV_VISIBLE_AFTER: 'Visible After',
 c4d.RNDAOV_VOLUME: 'Volume',
 c4d.RNDAOV_VOLUME_EMISSION: 'Volume Emission',
 c4d.RNDAOV_VOLUME_MASK: 'Volume Mask',
 c4d.RNDAOV_VOLUME_Z_DEPTH_BACK: 'Volume Z Depth Back',
 c4d.RNDAOV_VOLUME_Z_DEPTH_FRONT: 'Volume Z Depth Front',
 c4d.RNDAOV_WIRE: 'Wire',
 c4d.RNDAOV_WIRE_BMPNRML_MAP: 'Wire Bmpnrml Map',
 c4d.RNDAOV_WIRE_HGLTBACK: 'Wire Hgltback',
 c4d.RNDAOV_WIRE_SHADING: 'Wire Shading',
 c4d.RNDAOV_ZDEPTH: 'Zdepth',
 c4d.RNDAOV_ZDEPTH_ENVDEPTH: 'Zdepth Envdepth',
 c4d.RNDAOV_ZDEPTH_MAX: 'Zdepth Max',
 c4d.RNDAOV_ZDEPTH_N: 'Zdepth Normal'
 }